package dao;

import model.Student;

import java.util.List;
import java.util.Scanner;

//6
public class Demo_selectStudentList {
    public static void main(String[] args) {
        System.out.println("请输入班级名：");
        Scanner scanner=new Scanner(System.in);
        String className=scanner.next();
        //调用DAO获取结果
        StudentDao studentDao=new StudentDao();
        List<Student> list=studentDao.selectByClassName(className);
        if(list==null){
            System.out.println("没有查询到结果");
            return;
        }
        for(Student stu:list){
            System.out.println(stu.toString());
        }

    }
}
